<?php
require_once dirname(__FILE__) . '/../wog_act_config.php';
/**
 * 属性相关
 */

/**
 * 计算战斗属性
 */

function calcFightAttr($point = [])
{
    global $wog_array;
    if (empty($point)) {
        return null;
    }
    $trans_unit = $wog_array['ability_to_attr'];
    $fight_attr = [];
    echo json_encode($point);
    foreach ($point as $k => $v) {
        if (isset($trans_unit[$k])) {
            foreach ($trans_unit[$k] as $ak => $av) {
                $fight_attr[$ak] = ($fight_attr[$ak] ?: 0) + round($v * $av);
            }
        }
    }
    return $fight_attr;
}